class new_list:
    def __init__(self,*arg):
        self.values = [x for x in arg]
        self.count={}
    def __len__(self):
        return len(self.values)

    def __getitem__(self,key):
        try:
            self.count[self.values[key]]+=1
        except :
            self.count[self.values[key]]=1
        return self.values[key]

    def __setitem__(self,key,value):
        self.values[key] = value

    def __delitem__(self,key):
        del self.count[self.values[key]]
        self.values.remove(self.values[key])


    def index(self,value):
        try:
            return self.count[value]
        except KeyError:
            return 0


    def append(self,value):
        self.values.append(value)

    def pop(self):
        linshi=self.values.pop()
        del self.count[linshi]

    def remove(self,value):
        del self.count[value]
        self.values.remove(value)

    def insert(self,value,obj):
        self.values.insert(value,obj)

    def clear(self):
        self.values.clear()
        self.count.clear()

    def reverse(self):
        self.values.reverse()
        
c1=new_list(1,2,3,5)
c2=new_list(5,6,7,8)
